//
//  UIView+Helper.h
//  Doumi
//
//  Created by reyzhang on 2021/3/17.
//  Copyright © 2021 myjs. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface UIView (Helper)


//画线
- (void)drawLineWithRect:(CGRect)rect;
- (void)drawLineWithRect:(CGRect)rect lineColor:(UIColor *)color;
- (CAShapeLayer *)getShapeLayerWithRect:(CGRect)rect lineColor:(UIColor *)color;



//通过 xib加载
+ (UINib *)nib;
+ (instancetype)loadFromNib;
+ (NSString *)identifier;


//选择性加圆角
- (void)addRoundingCorners:(UIRectCorner)corners cornerRadii:(CGSize)cornerRadii;


//加线性渐变色
- (void)addLineGradientLayerWithColors:(NSArray *)colors
                         locations:(NSArray<NSNumber *> *)locations
                        startPoint:(CGPoint)startPoint
                          endPoint:(CGPoint)endPoint;


//加阴影效果
- (void)addShadowEffectWithColor:(UIColor *)shadowColor
                          offset:(CGSize)shadowOffset
                         opacity:(CGFloat)shadowOpacity
                          radius:(CGFloat)shadowRadius;
@end

NS_ASSUME_NONNULL_END
